package com.cosyhut.blocks.factory;

import com.jme.math.*;

public class MBlockLoader {
	static void load(String filename, BFactory f) {
		Vector3f p = new Vector3f();
		Quaternion r = new Quaternion();

		MBlock m = new MBlock("Block_T");
		
		p.set(0, 0, 0);
		r.loadIdentity();
		m.addGeom("Cylinder.Steel.20.200", p, r);
		
		p.set(0, 0, 0 - BFactory.units(100));
		r.loadIdentity();
		r.fromAngleAxis((float) (Math.PI / 2), new Vector3f(0, 1, 0));
		r.fromAngleAxis((float) (Math.PI / 2), new Vector3f(1, 0, 0));
		m.addGeom("Cylinder.Steel.20.200", p, r);

		r.loadIdentity();
		m.addJoint("Hinge.y", p, r);
		
		p.set(0, 0, BFactory.units(120));
		r.loadIdentity();
		m.addJointPoint(p, r);
		f.addBlockModel(m);
	}
}
